package com.guanyong.dao;

import com.guanyong.model.HistoryTodayModel;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.ResultMap;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * Created by mxk on 2017/6/6.
 */
public interface IHistoryTodayDaoMapper {


    @Select("SELECT * FROM t_ad_historytoday  where f_id=#{fId}")
    @ResultMap("HistoryTodayResultMap")
    HistoryTodayModel selectByPrimaryKey(Integer fId);

    @Select("SELECT * FROM t_ad_historytoday  where f_date=#{date} and f_classtype=#{classtype} " +
            "and f_objectid=#{objectid}")
    @ResultMap("HistoryTodayResultMap")
    HistoryTodayModel SelectByDateObjectId(@Param("date")String date,
                                           @Param("classtype") Integer classtype,
                                           @Param("objectid") String objectid);

    List<HistoryTodayModel> SelectHistoryTodayList(@Param("record") HistoryTodayModel record,
                                         @Param("offset") Integer offset,
                                         @Param("limit") Integer limit);

    Integer SelectHistoryTodayListCount(@Param("record") HistoryTodayModel record);

    int insert(@Param(value = "record") HistoryTodayModel record);

    int update(@Param(value = "record") HistoryTodayModel record);
}
